package com.itbaizhan.seckill.controller;

import com.itbaizhan.common.vo.LivegoodsResult;
import com.itbaizhan.seckill.service.SeckillService;
import org.apache.dubbo.qos.command.impl.Live;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制层
 */
@RestController
public class SeckillController {
    @Autowired
    private SeckillService seckillService;

    @GetMapping("/buytime")
    public LivegoodsResult buytime(Long id) {
        return seckillService.buytime(id);
    }

    @RequestMapping ("/buyaction")
    public LivegoodsResult buyaction(Long id,String user){
        return seckillService.buyaction(id,user);
    }
}
